#define  _CRT_SECURE_NO_WARNINGS
#include "Sort.h"

void TestInsertSort()
{
	int a[] = { 9,8,7,6,5,4,3,2,1 };
	int sz = sizeof(a) / sizeof(a[0]);
	InsertSort(a, sz);
	PrintArray(a,sz);
}

//void TestHeapsort()
//{
//	int a[] = { 9,8,7,6,5,4,3,2,1 };
//	int sz = sizeof(a) / sizeof(a[0]);
//	HeapSort(a, sz);
//	PrintArray(a, sz);
//}
void TestShellsort()
{
	int a[] = { 9,8,7,6,5,4,3,2,1,9,8,7,6,5,4,3,2,1,9,8,7,6,5,4,3,2,1,9,8,7,6,5,4,3,2,1 };
	int sz = sizeof(a) / sizeof(a[0]);
	ShellSort(a, sz);
	PrintArray(a, sz);
}

void TestSelectsort()
{
	int a[] = { 9,1,2,5,7,4,6,3 };
	int sz = sizeof(a) / sizeof(a[0]);
	SelectSort(a, sz);
	PrintArray(a, sz);
}

void TestHeapsort()
{
	int a[] = { 9,1,2,5,7,4,6,3 };
	int sz = sizeof(a) / sizeof(a[0]);
	HeapSort(a, sz);
	PrintArray(a, sz);
}

void TestQuicksort()
{
	int a[] = { 9,11,23,88,54,21,33,9,1,2,5,7,4,6,3 };
	int sz = sizeof(a) / sizeof(a[0]);
	QuickSort(a, 0, sz - 1);
	PrintArray(a, sz);
}

void TestQuicksortNoR()
{
	int a[] = { 0,5,4,8,5 };
	int sz = sizeof(a) / sizeof(a[0]);
	QuickSortNoR(a, 0, sz - 1);
	PrintArray(a, sz);
}

void TestMergesort()
{
	int a[] = { 9,11,23,88,54,21,33 };
	int sz = sizeof(a) / sizeof(a[0]);
	MergeSort(a, sz);
	PrintArray(a, sz);
}

void TestMergeSortNoR()
{
	int a[] = { 9,11,23,88,54,21,33,9,1,2,5,7,4,6,3 };
	int sz = sizeof(a) / sizeof(a[0]);
	//PrintArray(a, sz);
	MergeSortNoR(a, sz);
	PrintArray(a, sz);
}

void TestCountSort()
{
	int a[] = { 1,5,2,3,6,9,8,4,11,22 };
	int sz = sizeof(a) / sizeof(a[0]);
	CountSort(a, sz);
	PrintArray(a, sz);
}

void TestBubbleSort()
{
	int a[] = { 1,5,2,3,6};
	int sz = sizeof(a) / sizeof(a[0]);
	BubbleSort(a, sz);
	PrintArray(a, sz);
}

int main()
{

	//TestInsertSort();
	//TestHeapsort();
	//TestShellsort();
	//TestSelectsort();
	//TestHeapsort();
	//TestQuicksort();
	//TestMergesort();
	//TestMergeSortNoR();
	//TestQuicksortNoR();
	//TestCountSort();
	TestBubbleSort();
    //TestOP();

	return 0;
}